/* 引用字体库和 icons 库 */
@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,500,900);
@import url(https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css);

/* sample 样式 */
.sample {
  font-family: 'Source Sans Pro', Arial, sans-serif;
  position: relative;
  overflow: hidden;
  margin: 10px;
  min-width: 230px;
  max-width: 320px;
  max-height: 230px;
  width: 100%;
  color: #ffffff;
  text-align: center;
  font-size: 16px;
}
.sample * {
  box-sizing: border-box;
  transition: all 0.35s ease;
}

/* 图片的样式 */
.sample img {
  opacity: 1;
  width: 100%;
}

/* figcaption */
.sample:after,
.sample:before,
.sample figcaption:after,
.sample figcaption:before {
  background: #0a0a0a;
  width: 25%;
  position: absolute;
  content: '';
  opacity: 0;
  transition: all 0.3s steps(4);
  z-index: 1;
  bottom: 100%;
  top: 0;
}

.sample:before {
  left: 0;
  transition-delay: 0;
}

.sample:after {
  left: 25%;
  transition-delay: 0.1s;
}

.sample figcaption:before {
  left: 50%;
  transition-delay: 0.2s;
  z-index: -1;
}

.sample figcaption:after {
  left: 75%;
  transition-delay: 0.3s;
  z-index: -1;
}

/* figcaption 部分样式 */
.sample figcaption {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 30px;
}

/* 字体和 icons */
.sample h2,
.sample p,
.sample .icons {
  margin: 0;
  width: 100%;
  opacity: 0;
}

.sample h2 {
  font-weight: 900;
  text-transform: uppercase;
}

.sample p {
  font-weight: 300;
}

.sample .icons {
  position: absolute;
  bottom: 30px;
  left: 0;
  width: 100%;
}

/* 链接部分样式 */
.sample i {
  padding: 0px 10px;
  display: inline-block;
  font-size: 24px;
  color: #ffffff;
  text-align: center;
  opacity: 0.8;
}

/* 当鼠标放置时链接显示 */
.sample i:hover {
  opacity: 1;
}

/* 当鼠标放置时标题显示效果 */
.sample:hover:after,
.sample.hover:after,
.sample:hover:before,
.sample.hover:before,
.sample:hover figcaption:after,
.sample.hover figcaption:after,
.sample:hover figcaption:before,
.sample.hover figcaption:before {
  bottom: 0;
  opacity: 0.8;
}

.sample:hover figcaption h2,
.sample.hover figcaption h2,
.sample:hover figcaption p,
.sample.hover figcaption p,
.sample:hover figcaption .icons,
.sample.hover figcaption .icons {
  transition-delay: 0.4s;
}

.sample:hover figcaption h2,
.sample.hover figcaption h2,
.sample:hover figcaption .icons,
.sample.hover figcaption .icons {
  opacity: 1;
}

.sample:hover figcaption p,
.sample.hover figcaption p{
  opacity: 0.7;
}

/* 调整整个 body 的样式 */
html {
  height: 100%;
}

body {
  background: #212121;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-flow: wrap;
  margin: 0;
  height: 100%;
}